Finished coverting api to use external data iterator