Refactored code related to CORS. Moved it from app.js to global_settings