Check if json decode succeeded and the object contains tag, event variables.
Fix handshake response