improve 404 & 500 hooks in router, deprecate some unused controller functions and tidy up the logger