some bug fixes for caching of services. still not complete