reducing number of api calls