Add delay function to reduce API call rate.