Add iterator API. Need to add checks and exceps.