Fix api for index
Add groupby