Fixing server hanging after five api requests.