only parse json if status code is 200.
check that newVal is defined