Processing messages JSON from server