Tiny change in api.py docstring

Use double double colon to format example as source code