 xml2js = require 'xml2js'
 fogbugzURL = null
 
-SetURL = (url) -> fogbugzURL = url
+SetURL = (url) -> fogbugzURL = "http://" + url + "/api.asp?"
 
 #User Authentication
 LogOn = (username, password, callback) ->

 	CallApi(command, token, (err, result) ->
 		if err then callback(new Error('Error listing projects: ' + err.message)) else callback(null, result['projects'][0]['project'])
 	)

# Calls the Fogbugz XML Api and returns the result as JSON
# TODO: Better parsing of URL (eg use sax to parse it while it comes through)

exports.LogOn = LogOn
exports.LogOff = LogOff
exports.SetURL = SetURL
exports.ListProjects = ListProjects
exports.SearchCases = SearchCases