add failureCallback to MidiService; add tests for MidiService