Is this change safe? I seem to recall that order matters here... maybe because the lib middleware requires the loginapi too?