Fixed the unittests and implemented the html templates for all returned errors