simplified diagnostic object building and replaced json building with JavaScriptSerializer