Some more error handling, CORS support