public IHttpActionResult Submit(int problem_id, [FromBody] SubmissionFormData data) { if (!user_service.IsAuthorizedToSubmitToProblem(problem_id)) { return(Unauthorized()); } if (RequestUtility.IsPreFlightRequest(Request)) { return(Ok()); } try{ submission_repository.CreateProblemSubmission(problem_id, data); return(Ok()); } catch (ObjectNotFoundException e) { return(NotFound()); } }