 	public func authenticate(email: String, password: String) -> Promise<AuthToken> {
 		
 		self.email = email
+        UserDefaults.standard.set(email, forKey: "TeslaSwift.email")
 		self.password = password
 
 		let body = AuthTokenRequest(email: email,

	
	open var token: AuthToken?
	
	fileprivate var email: String?
	fileprivate var password: String?
    fileprivate var webSocket: WebSocket?
	

    // MARK: Streaming API
    
    static let streamingBaseURL: String = "wss://streaming.vn.teslamotors.com"
    static let streamParameters: [String] = ["speed", "odometer", "soc", "elevation", "est_heading", "est_lat", "est_lng", "power", "shift_state", "range","est_range", "heading"]

    
    private func getStreamURLRequest(vehicle: Vehicle) -> URLRequest? {
        guard let vehicleID = vehicle.vehicleID else {
            return nil
        }
        let vehicleIDString: String = String(describing: vehicleID)
        let streamParametersString: String = TeslaSwift.streamParameters.joined(separator: ",")
        let urlString = "\(TeslaSwift.streamingBaseURL)/stream/\(vehicleIDString)/?values=\(streamParametersString)"
        if let url = URL(string: urlString) {
            var request = URLRequest(url: url)
            if let token = self.token?.accessToken,
                let email = self.email {
                    let authString = String(format: "%@:%@", email, token)
                    let authData = authString.data(using: String.Encoding.utf8)!
                    let base64AuthString = authData.base64EncodedString()
                    request.httpMethod = "GET"
                    request.setValue(base64AuthString, forHTTPHeaderField: "Authorization")
                    return request
            }
        }
        return nil
