support also messages in JavaScript object format, not only JSON