public HttpResponseMessage Delete(TaskItemModel model)
        {
            var result = service.Delete(model);

            if(!result.Success)
                return Request.CreateResponse(HttpStatusCode.InternalServerError, result.Message);

            return Request.CreateResponse(HttpStatusCode.OK);
        }
        public HttpResponseMessage Update(string id,TaskItemModel model)
        {
            model.Id = id;
            var result = service.Create(model);

            if (!result.Success)
                return Request.CreateResponse(HttpStatusCode.InternalServerError, result.Message);

            return Request.CreateResponse(HttpStatusCode.Created, result.Task);
        }
        public HttpBaseResponse Delete(TaskItemModel model)
        {
            var task = db.Tasks.Where(t => t.Id.Equals(model.Id)).FirstOrDefault();

            if (task == null)
                throw new NullReferenceException("Task not found");

            db.Tasks.Remove(task);
            db.SaveChanges();

            return new HttpBaseResponse() { Success = true };
        }
        public CreateUpdateTaskResponse Create(TaskItemModel model)
        {
            if (string.IsNullOrEmpty(model.Id))
            {
                model.Id = Guid.NewGuid().ToString();
                db.Tasks.Add(model.ToEntity());
            }
            else
            {
                var task = db.Tasks.Where(t => t.Id.Equals(model.Id)).FirstOrDefault();

                if (task == null)
                    throw new NullReferenceException("Task not found");

                task.BoardId = model.BoardId;
                task.Category = model.Category;
                task.Index = model.Index;
                task.Name = model.Name;
            }

            db.SaveChanges();

            return new CreateUpdateTaskResponse() { Success = true, Task = model };
        }