Updated example with new API