Add retry count on lib to handle download data failure
refactor download method in lib
Move retry delay to lib, need test