fix error pages and controller tests