Fix bug where registerRoute was incorrectly using middleware method instead of all