Fix pagination

Currently python client can't query more than one page, b/c the method next returns a string object, which throws an error bc it's expecting a JSONschema object. This creates a new pagination object if a basestring is detected.