fixing algorithm for tracking last fetch from api.