adds a layout, refactor code in main into layout and define routes