Fixed empty returnFields error, added OFFSET to query for pagination.