Add CORS support for better error reporting across domains