 			json:true
 			method:"POST"
 			timeout:1000
-			url: "#{settings.apis.analytics.url}/user/#{user_id}/event/last_occurnace"
+			url: "/user/#{user_id}/event/last_occurnace"
 		makeRequest opts, (err, response, body)->
 			if err? 
 				console.log response, opts
 				logger.err {user_id, err}, "error getting last occurance of event"
 				return callback err
 			else
-				return callback null, body+				return callback null, body

			json:true
			method:"POST"
			timeout:1000
			url: "#{settings.apis.analytics.url}/user/#{user_id}/event"
		makeRequest opts, callback



request = require "request"


makeRequest = (opts, callback)->
	if settings.apis?.analytics?.url?
		urlPath = opts.url
		opts.url = "#{settings.apis.analytics.url}#{urlPath}"
		request opts, callback
	else
		callback()
