Chris/Chuan, added history cache and test for it