Cache implemented and unit tests updated