public HttpResponseMessage AddTraining(int id, int trainingId) { var repo = new EmployeeRepository(); var addTraining = repo.AddTrainingToEmployee(id, trainingId); return(addTraining ? Request.CreateResponse(HttpStatusCode.Created, "A training has been added to this employee!") : Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "There was an error creating this training, please try again later.")); }