Moved installing handlers to be the first thing to be done. If frontend
sends a request before backend becomes ready, the requesy will be lost.
It's a temporary fix for now. frontend needs to make sure backend is
ready before it starts sending requests/messages.