callback that handles errors/access tokens