Change the way to declare API routes
Add Error() hook to send a JSON response when it fail
Cleanup API routes