improved promise use for authentication and errors