Adding Json Format for communication over socket and adding some Javadoc