Gracefully handle invalid payloads
Add support for overriding CORS middleware options