public HttpResponseMessage PostCreateMonster(
            MonsterModel model,
            [ValueProvider(typeof(HeaderValueProviderFactory<string>))] string sessionKey)
        {
            var responseMsg = this.PerformOperationAndHandleExceptions(
                () =>
                {
                    if (model.Name == null)
                    {
                        throw new ArgumentNullException("name", "The name cannot be null!");
                    }

                    var context = new StoreContext();
                    using (context)
                    {
                        var admin = context.Admins.FirstOrDefault(adm => adm.SessionKey == sessionKey);
                        if (admin == null)
                        {
                            throw new InvalidOperationException("You are not admin!");
                        }

                        var monster = new Monster()
                        {
                            Name = model.Name,
                            MeleAttack = model.MeleAttack,
                            MagicAttack = model.MagicAttack,
                            MagicDefense = model.MagicDefense,
                            MeleDefense = model.MeleDefense,
                            HP = model.HP
                        };

                        context.Monsters.Add(monster);
                        context.SaveChanges();

                        var createdMonsterModel = new CreatedMonsterModel()
                        {
                            Monsterid = monster.MonsterId,
                            Name = monster.Name
                        };

                        var response =
                            this.Request.CreateResponse(HttpStatusCode.Created, createdMonsterModel);
                        return response;
                    }
                });

            return responseMsg;
        }
        private void UpdateMonster(Monster monster, MonsterModel model, StoreContext context)
        {
            if (model.Name != null)
            {
                monster.Name = model.Name;
            }

            monster.MagicAttack = model.MagicAttack;
            monster.MagicDefense = model.MagicDefense;
            monster.MeleAttack = model.MeleAttack;
            monster.MeleDefense = model.MeleDefense;
            monster.HP = model.HP;
        }