Update auth code to work with new API format