Fix a bug initializing the api_key