Update sample to use new API