reduce api calls to server