// POST api/StoryCard
        public HttpResponseMessage PostStoryCard(StoryCard storycard)
        {
            if (ModelState.IsValid)
            {
                db.StoryCards.Add(storycard);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, storycard);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = storycard.Id }));
                return response;
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        // PUT api/StoryCard/5
        public HttpResponseMessage PutStoryCard(int id, StoryCard storycard)
        {
            if (ModelState.IsValid && id == storycard.Id)
            {
                db.Entry(storycard).State = EntityState.Modified;

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

                return Request.CreateResponse(HttpStatusCode.OK);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
 public void Delete(StoryCard storyCard)
 {
     _db.StoryCards.Remove(storyCard);
     _db.SaveChanges();
 }
 public StoryCard Create(StoryCard storyCard)
 {
     _db.StoryCards.Add(storyCard);
     _db.SaveChanges();
     return storyCard;
 }
 public void UpdateStory(StoryCard story)
 {
     _repository.Update(story);
     Clients.Caller.storyUpdated(story);
 }
 public void CreateStory(StoryCard story)
 {
     _repository.Create(story);
     Clients.Caller.addedStory(story);
 }
 public StoryCard Update(StoryCard storyCard)
 {
     _db.Entry(storyCard).State = EntityState.Modified;
     _db.SaveChanges();
     return storyCard;
 }
 public void CreateStory(StoryCard story)
 {
     Caller.AddedStory(story);
 }