add more error checking to data conversion in response