add session wrapper, fix routing