add retry feature and seperate request function
add retry feature and seperate request function