update to authentication and error handling