Dupsort: fix prefix queries to support passing as query param or in json

@benbjohnson @mkobetic @charlescng