Modernize components, remove some dead code, provide JSON output with the right content-type