Reducing unnecessary api calls