Add debug messages
Catch json parse errors

- update hangleError method
Merge pull request #21 from LazyParking/fix-server-kill

Fix server kill