 	var nextAttemptAt: NSDate
 	var duration: NSTimeInterval
 }
+
+#if DEBUG
+	#if os(iOS)
+		let userAgent = "HouseTrip-Trailer-v\(currentAppVersion)-iOS-Development"
+	#else
+		let userAgent = "HouseTrip-Trailer-v\(currentAppVersion)-OSX-Development"
+	#endif
+#else
+	#if os(iOS)
+		let userAgent = "HouseTrip-Trailer-v\(currentAppVersion)-iOS-Release"
+	#else
+		let userAgent = "HouseTrip-Trailer-v\(currentAppVersion)-OSX-Release"
+	#endif
+#endif
 
 class API {
 

		failure:((response: NSHTTPURLResponse?, error: NSError?)->Void)?) {

			#if os(iOS)
			dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (Int64)(0.1 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) {
				self.networkIndicationStart()
			}
			#endif

			let r = NSMutableURLRequest(URL: url, cachePolicy: NSURLRequestCachePolicy.UseProtocolCachePolicy, timeoutInterval: NETWORK_TIMEOUT)
			r.setValue(userAgent(), forHTTPHeaderField: "User-Agent")

			let task = urlSession.dataTaskWithRequest(r) { (data, res, e) in

				let response = res as? NSHTTPURLResponse
				var error = e

		config.HTTPShouldUsePipelining = true
		config.timeoutIntervalForResource = NETWORK_TIMEOUT
		config.timeoutIntervalForRequest = NETWORK_TIMEOUT
		config.HTTPAdditionalHeaders = ["User-Agent" : userAgent]
		urlSession = NSURLSession(configuration: config)

		if fileManager.fileExistsAtPath(cacheDirectory) {
