change API_KEY order. and minor variable renaming.