public IHttpActionResult AddTask(entities.Task newTask) { try { if (!ModelState.IsValid) { return(BadRequest()); } _TaskBO = new TaskBO(); _TaskBO.AddTask(newTask); return(Ok("Success")); } catch (Exception) { return(Ok("Error")); } }