Added tests for authentication

Added tests for authentication and added some more validation to `register_user`