Web refactor fixes
Aims to fix the 500 status errors introduced by the JSON API branch that was merged in: #44 (closed)
I've fixed some of the problems, of which it'll definitely not run without it. I haven't found everything though, so I'm leaving it a work in progress for now. Part of the problem I've encountered is that I can't reproduce the production environment in my local build, and the other problem is that running the CGI script directly returns html whether there are errors or not, but Apache will just straight up give 500 errors if anything goes wrong. I'd like to find a better way to test any changes to the web code.
Edited by Patrick Godwin