Better handling of invalid JSON in the payload