Fixed session in db api