send an error to frontend to be displayed on error page
include an error code understandable to user, and a message to be displayed
for example, code: 500, message: Internal server error could be used when some logic in the backend breaks and its not the user's fault
note that i overwrote a lot of mongoose errors to something that is usable by viewer, but not by us. for example if mongoose passed an error about a table not existing, i would instead send an error code: 500, message: Internal server error to the api that uses the mongoose query. this is useful for viewer, but not for dev
check every middleware, model, function etc etc being called by these apis for errors
for each route: