docs: fix api example
Merge pull request #919 from jonboulle/api_fix

docs: fix api example