public HttpResponseMessage Post(Subtask subtask)
        {
            if (ModelState.IsValid)
            {
                using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork())
                {
                     unitOfWork.Repository<Subtask>().AddItem(subtask);
                }

                _subtaskService.CheckSubtasks(subtask.TaskId);

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, subtask);
            //                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = subtask.Id }));
                response.Headers.Location = new Uri(Url.Link("PostSubtask", new { id = subtask.Id }));

                return response;
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        public HttpResponseMessage Put(int id, Subtask subtask)
        {
            using (var unitOfWork = _unitOfWorkFactory.CreateUnitOfWork())
            {
                if (ModelState.IsValid && id == subtask.Id)
                {
                    unitOfWork.Repository<Subtask>().AttachItem(subtask);

                    try
                    {
                        unitOfWork.SaveChanges();
                    }
                    catch (DbUpdateConcurrencyException)
                    {
                        return Request.CreateResponse(HttpStatusCode.NotFound);
                    }

                    _subtaskService.CheckSubtasks(subtask.TaskId);

                    return Request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    return Request.CreateResponse(HttpStatusCode.BadRequest);
                }
            }
        }