public JsonResult MakeCourseActive(int id) { try { _repository.UpdateCourseToActive(id); Response.StatusCode = (int)HttpStatusCode.Accepted; return(Json("course started")); } catch (Exception ex) { _logger.LogError("Failed to start course", ex); Response.StatusCode = (int)HttpStatusCode.BadRequest; return(Json("Failed to start course")); } }