doc: rework API for consistency