update example to use new api