 
 public class JSONRequestOperation: RequestOperation {
     
+    internal var serialization: JSONSerialization.Type
+    
+    public init(serialization: JSONSerialization.Type) {
+        self.serialization = serialization
+    }
+    
     public func build(url: URL, method: RequestMethod, data: [AnyHashable: Any]) -> URLRequest {
         var request = URLRequest(url: url)
         request.addValue("application/json", forHTTPHeaderField: "Accept")

            request.addValue("application/json", forHTTPHeaderField: "Content-Type")
            
            if !data.isEmpty {
                request.httpBody = try? JSONSerialization.data(withJSONObject: data, options: .prettyPrinted)
            }
            
        default:

            return .error(RequestError.unparseableJSON)
        }
        
        guard let jsonObject = try? serialization.jsonObject(with: resultStringData, options: []) else {
            return .okay(resultString)
        }
        
        return .okay(jsonObject)
    }
}

extension JSONRequestOperation {
    
    public class func create() -> JSONRequestOperation {
        let serialization = JSONSerialization.self
        let operation = JSONRequestOperation(serialization: serialization)
        return operation
    }
}
