order of routes, api route error handler