Fix bug when retrieving data from postgres.
Return UserNotFoundErrors when authenticating.