Added basic error checking in data requests