Fixed README example code

I changed the code in the README into a working example for the current API.

I am aware that this version does not include proper exception handling,
which might be okay for this small introductory example. Hope this helps.