Sample code for using the ServiceApi