refactor download to use new api.