add implementation for document service.