code: function returnErrorAndData (error, data, response) {
    if (typeof (response) === 'function') {
      return response(error, data)
    }
  
    if (!response.headersSent) {
      return response.status(406).end(JSON.stringify({
        errors: error,
        data:   data
      }))
    }
  }
docs: In case database call return some data AND error.
  If response parameter is a function consider this is a returnErrorAndData callback function to call,
  else check if server response headers aren't send yet, log and flush stack trace (if allowed) and
  return response with status 406 with stringified data and error in a literal object as content
  
  @param error - A server/database error
  @param data - The server/database data
  @param response - The server response or returnErrorAndData callback
  @returns {*} callback call or response with status 406, associated error and data