Modernize Legacy API to RESTful Standards

Refactor legacy API endpoints to follow modern REST.

category:modernization
api
rest
backend
refactor
http
0

Prompt

Refactor this legacy HTTP handler into a RESTful endpoint.

Guidelines:
- Use nouns for resources (e.g. /users, /orders)
- Use correct HTTP verbs (GET, POST, PUT/PATCH, DELETE)
- Return appropriate status codes and error shapes
- Add pagination parameters where needed
- Separate validation, business logic, and persistence

Show the new handler and explain the REST improvements you've made.