     json =
       queries: [name: 'QUERY', expression: query]
       region: region
-    uri += "?__json__=#{ encodeURIComponent (JSON.stringify json) }"
-    @collection uri, 'variant', {page_number}
+    @collection URI(uri).setQuery('__json__', JSON.stringify(json)),
+      'variant', {page_number}
     .then ({items, pagination}) ->
       # We only support one query, so we flatten the query results.
       for item in items

      pagination: {total: 0, current: 0}

  request: (uri, options={}) =>
    uri = URI(uri).absoluteTo(@root).toString()
    xhr = $.ajax uri,
      beforeSend: (r) =>
        addAuth r, @login, @password
        addVersion r

        variations: root.variation_collection.uri

  annotation: (uri) =>
    @request URI(uri).setQuery 'embed',
      'original_data_source,annotated_data_source'
    .then ({annotation}) -> annotation

  annotations: ({filter, page_number}={}) =>
    uri = URI(@uris.annotations).setQuery 'embed',
      'original_data_source,annotated_data_source'
    if filter == 'own'
      uri.setQuery 'annotated_data_source.user', @current_user?.uri
    @collection uri, 'annotation', {page_number}

  create_annotation: (data) =>
