refactor the instance api calls