changed websockets to json response
merged and fixed conflicts