Updating examples to the new API
Updating State example to use the new APIs