public IHttpActionResult DeleteProblem(int id) { if (!user_service.IsAuthorizedToDeleteProblem(id)) { return(Unauthorized()); } try { problem_repository.DeleteProblem(id); } catch (ObjectNotFoundException e) { return(InternalServerError(e)); } return(Ok()); }