Rack Middleware for gracefully handling exceptions for JSON APIs.