Assume that the server only sends strings, so we can replace this by `data = JSON.parse(msg)`