implement registration and authrntication