encode json for tryit