fixed key errors in api calls