Wrapper function to handle JSON responses and errors for route handlers
Supports three return patterns:
The route handler function
Optional
Optional ResponseContext for customizing response properties
A wrapped handler function that handles JSON responses and errors
Wrapper function to handle JSON responses and errors for route handlers
Supports three return patterns: