Completed the document api.