Refactor html template for headers endpoint