set up basic middleware and templates