automatic pagination of json results, wraps curl