example of how to use api