Refactor the scheduler so that it doesn't create a repeating timer. Only refresh the API after a successful refresh.