Various fixes

Adds template inheritance and fixes JSON parse errors on frontend.