added templating and got fetch function to pull data