adjusting examples to use the latest api