fix datastore exception handling and auth handling