prevent errors on larger responses
follow common coding practice with callbacks
tidy up and some better error handling
fixing some typos and other minor issues
Merge pull request #2 from nodecraft/dev

Global tidy up and some better error handling