almost working server and template webpage