Connecting to db
Creating templates