fix for "next" in group api

http://manage.dimagi.com/default.asp?121551
Merge pull request #3771 from dimagi/case-121551

fix for "next" in group api