adding support for segments along with unit tests
implemented cache clear and added unit tests
adding exists along with unit tests... zomfg all teh API operations are written!