Add some doc comments to API code [ci skip]