Minor bug fixes

Make API requests node 0.10.x compatible, fix error messages, + some
other minor fixes in demo.js