wait for API requests to have finished before checking dealloc counts