re-authentication and api wrapper