Improve request processing, use correct notebook, and handle notebook change case