Changing json library fixing some incorrect socket assignments