[refact] code refactoring

decoupling JSON parsing code from websocket connectivity code

Change-Id: I410dbb24dbd0214bf1c51b75587028d67fc2803c