Refactored code

DId some refactoring so that the core_api….cache functions could be
used to generate the client html for webapp.