adds auth middleware on all calls to /api/schema

use 'error'