add ability to pull templates from database