Update doc/api.md

Fix the code block syntax in the markdown.