JSON API: Detect if request was a search query, and if it was, return empty array instead of error.

This is a better way of handling the search requests.