         guard let content = try? body.serialize() else {
             let failureReason = "Content items could not be serialized to JSON."
             let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
-            let error = NSError(domain: PersonalityInsights.domain, code: 0, userInfo: userInfo)
+            let error = NSError(domain: domain, code: 0, userInfo: userInfo)
             failure?(error)
             return
         }

    private let username: String
    private let password: String

    private static let domain = "com.ibm.watson.developer-cloud.WatsonDeveloperCloud"
    private static let serviceURL = "https://gateway.watsonplatform.net/personality-insights/api/v2"
    private static let profileURL = serviceURL + "/profile"

    public init(username: String, password: String) {
        self.username = username

        // construct REST request
        let request = RestRequest(
            method: .POST,
            url: serviceURL + "/profile",
            acceptType: "application/json",
            contentType: contentType,
            queryParameters: queryParameters,
