public object Post(UserRegister request)
        {
            var validator = new UserRegistrationValidator();
            var result = validator.Validate(request);

            if (!result.IsValid) {
                var ex = result.ToErrorResult().ToResponseStatus();
                var response = new UserRegisterResponse {
                    Request = request,
                    ResponseStatus = ex,
                };
                return new HttpResult(response, HttpStatusCode.BadRequest);
            }

            // Add the new user to the database
            Users.Create(request.User);

            return HttpResult.Redirect(Url.Content("~/home"));
        }
 public object Get(UserRegister request)
 {
     if (this.GetSession().IsAuthenticated) return HttpResult.Redirect(Url.Content("~/home"));
     return new UserRegisterResponse();
 }