fix user auth, added exception handling, unit tests