adding an API reference to the README and fixing code sample