caching of endppoint map
neatify code