preview router and error handler