making things work with the DB. current state is not super broken. also added small templates.