Return empty array when no results.

Previously nil was being returned on API errors,
which caused un-helpful exceptions.