     .then ({token}) -> token
 
   tokens: ({filter, page_number}={}) =>
-    uri = @uris.tokens
-    uri += "?user=#{ encodeURIComponent @current_user?.uri }" if filter == 'own'
+    uri = URI @uris.tokens
+    uri.setQuery 'user', @current_user?.uri if filter == 'own'
     @collection uri, 'token', {page_number}
 
   create_token: (data) =>

      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

    @request uri, method: 'DELETE'

  sample: (uri) =>
    @request URI(uri).setQuery embed: 'user,groups'
    .then ({sample}) -> sample

  samples: ({filter, group, page_number}={}) =>
    uri = URI @uris.samples
    uri.setQuery 'user', @current_user?.uri if filter == 'own'
    uri.setQuery 'public', 'true' if filter == 'public'
    uri.setQuery 'groups', group if group?
    @collection uri, 'sample', {page_number}

  create_sample: (data) =>
