[server][GateJSON] Extract JSON message related code as a class