Fixes #235 - Return a proper error message when JSON payload is malformed.
Merge pull request #249 from AdrianGaudebert/235-catch-malformed-json

Fixes #235 - Return a proper error message when JSON payload is malformed.