Minor modifications to document API.