changes in create_session with tests. fixes #7, fixes #8, fixes #9, fixes #11