URGENT : API exposing entire SQL query despite Debug Mode is turned Off

When debug is false it should always output 'A server error occured, to see the error enable the DEBUG flag.'. You can also add a custom 500 page to your project where you can have your own message Creating Custom Error Pages in NodeJS.