public UserRegistration register(@FormParam("user") String name, @FormParam("password") String password) {
if (accounts.getAccount(name) != null) {
throw new WebApplicationException(400);
}
accounts.setAccount(name, new UserAccount(name, password));
return new UserRegistration(name);
}