Fix server sturcture and template file extension and template bugs.