Add docinfo API in extension

Resolves #1162