Adding JSON serialization for socket string