fixed auth.py for new model
better rest error handling