Added session management and tweaked the notes controller