Cache dictionaries after downloading

+ Added cache
+ Split callback function into two: success and failure
+ Refactoring a bit