expanding the error-handling of the new token api calls by using the status codes.