         
         addRelationshipsToResource(data: &data, relationships: relationships)
         
-        return [Key.data: data as! JSONObject]
+        return [Key.data: data]
     }
     
     private static func addRelationshipToResource(data: inout NSMutableDictionary, relationship: JSONObject?) {

    private static func addRelationshipsToResource(data: inout NSMutableDictionary, relationships: [JSONObject]?) {
        
        if let relationships = relationships {
            var relationshipsObject = NSMutableDictionary()
            for relationship in relationships {
                relationshipsObject.addEntries(from: relationship)
            }
            
            data[Key.relationships()] = relationshipsObject as! JSONObject
        }
    }
    
    private static func jsonForResourceDataWith(type: String, id: String? = nil, attributes: JSONObject?) -> NSMutableDictionary {
        
        var data: NSMutableDictionary = [Key.type: type]
        
        if let id = id {
            data[Key.id] = id

        
        addRelationshipToResource(data: &data, relationship: relationship)
        
        return [Key.data: data]
    }
    
    private static func jsonForResourceWith(type: String, id: String?, attributes: JSONObject?, relationships: [JSONObject]?) -> JSONObject {
