Fixed bug when API_KEY cannot be loaded