minor clean-up

add end/error callbacks
jshint
Merge pull request #2 from TheThingSystem/master

minor clean-up