rewrite to use json objects and dynamic view of sites