Implement create session and add tests.