removed global api variable