Investigate middleware implementation similar to the approach described here: https://thecodebarbarian.com/80-20-guide-to-express-error-handling