Updated the example to fit the API changes