add validation for footers and headers, output nice error messages, testcoverage