added optimal sleep time for max api calls