Fix bug that causes repeated requests to the API