Rewrite things to just spit out json
Let any JSONable type be used
Remove unused imports