Updating examples to use the new API