How to Write Effective API Sample Code