Working JSON/html

TODO: test cases