adding initial authentication and error handling framework