Updated example for new APIs