updated code snippet to use the new simplificated API and added default ...

...success and failure handlers to be more in sync with android