changes api_key reference from constant to variable