Created test for authentication and cleaned the code
Fixed getUser-methods so they return null when no such user is present.