changed front end socket code to accept json string