Changed API so it returns a table of results