Adapting API to session mode.