added api for downloads. Close #164