Change from outputting html to json