Implemented api.add_session.