@POST
    @Timed
    @Path("changePassword")
    @Consumes("application/x-www-form-urlencoded")
    @Produces(MediaType.TEXT_HTML)
    public Response changePassword(@CookieParam("authUser") String token, @FormParam("passwordVerify") @NotNull String passwordVerify, @FormParam("password") @NotNull String password, @FormParam("passwordConfirm") @NotNull String passwordConfirm) {
        try {
            UserToken verifiedUserToken = doVerifyUserToken(token);
            //Verify logged in
            if (verifiedUserToken == null) {
                return Response.seeOther(new URI(LOGIN_HTML.toString()+"?destination="+URLEncoder.encode(serviceBaseURL+"changePassword.html","utf8"))).cacheControl(NO_CACHE_CONTROL).build();
            }

            //Verify passwords
            if (Strings.isNullOrEmpty(passwordVerify) ||
                    Strings.isNullOrEmpty(password) ||
                    Strings.isNullOrEmpty(passwordConfirm) ||
                    !verifiedUserToken.userAccount.hashedPassword.equals(UserAccount.hashPassword(passwordVerify, salt)) ||
                    !password.equals(passwordConfirm) ) {
                return Response.seeOther(new URI(serviceBaseURL+"changePassword.html?message="+URLEncoder.encode("Something wasn't right, please try again","utf8"))).cacheControl(NO_CACHE_CONTROL).build();
            }

            //Update user's password
            verifiedUserToken.userAccount.hashedPassword = UserAccount.hashPassword(password, salt);
            dataStore.updateUser(verifiedUserToken.userAccount);

            return Response.seeOther(new URI(LANDING_HTML.toString() + "?message=" + URLEncoder.encode("Your password has been changed", "utf8"))).cacheControl(NO_CACHE_CONTROL).build();
        } catch (Exception e) {
            L.error("Wasn't able to change password", e);
            throw new WebApplicationException(Response.serverError().cacheControl(NO_CACHE_CONTROL).cookie(newEmptyExpiredCookie()).build());
        }
    }