First version of the example using the api.