public async Task <IHttpActionResult> MarkAsCompleted(int id) { var task = await taskService.GetById(id); if (task == null) { return(NotFound()); } var updatedTask = await taskService.MarkAsCompleted(id); return(Ok(updatedTask)); }