cleaning up the 404 and 500 error messages and some basic housekeeping