Added caching mechanism to apigen, should save a bunch of time.