Re-ordering path matching, to prefer path with backend specified.
Re-ordering path matching, to prefer path with backend specified.

The backend that I was choosing wasn't being respected.
After confirming (with bin/dump_file) that the backend
should have had the right data (and killing the relevant
backend and not seeing any change) and adding some logging,
I realized that the :backend parameter wasn't being
passed along into api.go.

Based on my reading of pat/mux.go, specifically:

      if ph.pat != "/" && len(ph.pat) > 0 && ph.pat[len(ph.pat)-1] == '/' {
              return p, true

It seems that any pattern that ends with a slash can match
even if there's random stuff after it.  And, yes, the Add()
calls are ordered.

I've tested the /api call manually.  The /search path seems
to have the same issue, so I changed that too.

lekkas/livegrep,lekkas/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,lekkas/livegrep,wfxiang08/livegrep,paulproteus/livegrep,paulproteus/livegrep,paulproteus/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,paulproteus/livegrep,lekkas/livegrep,paulproteus/livegrep,wfxiang08/livegrep,paulproteus/livegrep,lekkas/livegrep,lekkas/livegrep