added template management working on connecting db