Another useful thing would be registering into error handling
StatusPages
feature and adding some more information for errors on API routes, like if there is missing parameter, so that you can produce error page with some actual help on how to properly use it.