Use cls if given in event for json

If we want encode special data, we cannot use tornadio... So I write this little patch for doing the job