Added registering and authenticating