server2: implement skeleton inner download loop
also add the last outer loop logic