split data creation and caching from server.js