I have a REST API built with express.js and an SPA, which are communicating with each other. I have my error handling middleware as explained here. I get the correct error code