Added error pages and front-end refactoring