Registration added, authentication fixed