You specify error code to send on res.apiError ( added as a parameter  )

Add `code` parameter to res.apiError, this way you can send a different code of 500 if you want