// PUT api/values/5
        public void Post(HttpRequestMessage request, TimeWarpCommand command, TimeWarpAgent agent = TimeWarpAgent.Unknown)
        {
            long id;

            if (!_authenticationManager.TryAuthenticateForWriteOperation(request.GetToken(), out id))
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden));
            }

            if (Log.IsDebugEnabled)
            {
                Log.DebugFormat("updating userState for account ({0}) with command ({1})", id, command);
            }

            var requestTime = _nowProvider.Now;

            var account = _accountRepository.Get(id);

            if (account == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NoContent));
            }

            switch (command)
            {
            case (TimeWarpCommand.Work):
                _userStateManager.StartWork(account, requestTime, (int)agent);
                break;

            case (TimeWarpCommand.Rest):
                _userStateManager.StartRest(account, requestTime, (int)agent);
                break;

            default:
                throw new InvalidEnumArgumentException("command", (int)command, typeof(TimeWarpCommand));
            }
        }