## Challenge Overview
Create a complete REST API for user management with the following requirements:
### Requirements:
1. Implement GET endpoint to fetch all users
2. Implement GET endpoint to fetch a single user by ID
3. Implement POST endpoint to create a new user
4. Implement PUT endpoint to update an existing user
5. Implement DELETE endpoint to remove a user
6. Add proper error handling for invalid requests
7. Validate user data (email format, required fields)
### Starter Code:
The basic structure is provided. Complete the TODO sections.
### Test Cases:
- GET /api/users should return an array of users
- GET /api/users?id=1 should return a single user
- POST /api/users with valid data should create a user
- Invalid email should return 400 error
api/users/route.ts