Added directory creation
Added templates and middleware settings