Update api.py

Use double double colon to format example as source code