use new sync api for downloading

1. disable updateDocumentCount which will freeze gui
2. move api definition to .h file
3. use new sync api for downding object data