Better table retrieval api.
Also fix some paging bugs