Updating the API to the new API

JAVA-1325
I don't like this document stringification, as the document could be either very very large or not define a proper toString method.