Non existent key in data store returns key error when using data.getval

Check if the key exists before returning, if the key does not exist, getval will return None instead of a key error.