Move session ID to app monad & refactor