Support handleError when no backend is selected
Run middleware before getting backend

This allows middleware to terminate requests and improves quite a good
amount of other things
Handle failures when selecting backend