Replace named constructor Device.from_cache() with static method Device.new_from_cache() to catch errors when loading from cache and return null in such case.