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

This also improves the way exceptions are used to invoke HTTP error responses.
This is the same logic as above. I just pulled it out to its own function so I could call it without the decorator stuff.