Added options handling for CORS compliance