mock sessions, fix tests