Refactoring filesystem writing
Handle routes without filename