Implementing the search API to use a Google Search Appliance backend.

This also improves the way exceptions are used to invoke HTTP error responses.