It does end in e minor but isn't that rather breaking the rules - ending on the dominant of the key.. I was always taught the tonic of the key should be the last note.
Ionian: The German words at the bottom of the page mean Da Capo al Fine. Fine(which means end of piece) is measure 24. That's where the music ends.