Change json.send to emit