Event fired now depends on HTTP response rather than parameters passed to put
Improved variable name, taken out spurious output
Style cleanup