Return 404 for /404
Return 500 for /500
Move common code into helper function
Extract error handling code to rack middleware
Use 'rack/server_errors'
Move common code into helper function json_halt
Use Sinatra::JSON::json
Move common code into helper function parse_request
Add to_camel method and to_snake method to String
Extract camelCase-to-snake_case converter to rack middleware
Use 'rack/camel_snake'
Fix memory leak