 			parameters.oauthio = oauthio
 
 			# let oauth modules do the request
-			oa.request provider, parameters, req, (err, api_request) ->
+			oa.request provider, parameters, req, (err, options) ->
 				return cb err if err
+				api_request = request options
 
 				api_request.pipefilter = (response, dest) ->
 					dest.setHeader 'Access-Control-Allow-Origin', origin

exports.setup = (callback) ->

	fixUrl = (ref) -> ref.replace /^([a-zA-Z\-_]+:\/)([^\/])/, '$1/$2'

	doRequest = (req, res, next) =>
		cb = @server.send(res, next)

qs = require 'querystring'
Url = require 'url'
restify = require 'restify'
request = require 'request'

oauth =
	oauth1: require '../../lib/oauth1'
