Fixed example code

Changed the code in 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.
Merge pull request #2 from cyroxx/fix-example

Fixed README example code