added local var and fixed alchemy api call