                 
                 if(result.isSuccess) {
                     
-                    if let addressDict = result.value as? NSDictionary {
-                        let address = EasyPostAddress(jsonDictionary: addressDict)
+                    if let resultDict = result.value as? NSDictionary {
+                        
+                        if let error = self.checkForApiResultError(resultDict) {
+                            completion(result: EasyPostResult.Failure(error))
+                        } else {
+                            let address = EasyPostAddress(jsonDictionary: resultDict)
                     
-                        completion(result: EasyPostResult.Success(address))
+                            completion(result: EasyPostResult.Success(address))
+                        }
+                    } else {
+                        print("Result was successful, but blank.")
+                        completion(result: EasyPostResult.Failure(NSError(domain: self.errorDomain, code: 2, userInfo: nil)))
                     }
                     
                     

        return parameters
    }
    
    //Post and address model and get an address object with id populated back
    public func postAddress(address:EasyPostAddress, completion: (result: EasyPostResult<EasyPostAddress>) -> ()) {
        

import Alamofire

public class EasyPostApi {
    
    let errorDomain = "com.technomagination.EasyPostApi"
    
    var apiToken = ""               //Pass in via setCredentials
    var apiBaseUrl = ""             //Pass in via setCredentials
