JSON.parse messages before passing them to api.