added clients for document service, fixed bugs