public dynamic Get(string id)
        {
            var account = (id == "new") ? new Account() : (id.IsObjectId()) ? _accountRepository.GetById(id) : _accountRepository.Get(id);

              var model = new ExtendedAccountModel();
              model.MapFrom(account, _queryRepository.All());

              return model;
        }
        public dynamic Put(string id, ExtendedAccountModel model)
        {
            var account = (id.IsObjectId()) ? _accountRepository.GetById(id) : _accountRepository.Get(id);

              if (account == null) {
            return NotFound();
              }

              model.MapTo(account, _queryRepository);

              _accountRepository.Save(account);

              return Ok();
        }
        public dynamic Post(string id, ExtendedAccountModel model)
        {
            if (string.IsNullOrEmpty(model.Id) || model.Id == Guid.Empty.ToString()) {
            model.ApiKey = Guid.NewGuid().ToString();
            model.Id = model.ApiKey;
              }

              var account = new Account();
              model.MapTo(account, _queryRepository);
              _accountRepository.Save(account);

              return Ok();
        }