// PUT: api/tasks/5 public HttpResponseMessage Put(int id, [FromBody] Task value) { TasksConfig task = new TasksConfig(); bool recordExisted = false; recordExisted = task.updateTask(id, value); HttpResponseMessage response; if (recordExisted) { response = Request.CreateResponse(HttpStatusCode.NoContent); } else { response = Request.CreateResponse(HttpStatusCode.NotFound); } return(response); }