added try/catch to protect json parse; added sendConnectMessage flag to server connections