(function (env) {
    "use strict";
    env.ddg_spice_ski_resorts = function(api_result) {

        // Validate the response (customize for your Spice)
        if (!api_result || api_result.error) {
            return Spice.failed('ski_resorts');
        }

        var lon = (Math.round(api_result.location[0] * 100) / 100).toFixed(2);
        var lat = (Math.round(api_result.location[1] * 100) / 100).toFixed(2);
    
        DDG.require('maps', function() {
            Spice.add({
                id: api_result.name,
                name: "Ski Resort",
                model: 'Place',
                view: 'Map',
                templates: {
                    item: 'places_item',
                    detail: 'places_detail'
                },
                data: [{
                    id: api_result.name,
                    name: api_result.title,
                    url: 'http://www.piste.io/' + api_result.name,
                    image: 'http://www.piste.io/preview/' + api_result.name + '.jpg',
                    ratingImageURL: 'http://www.piste.io/favicon.ico',
                    address_lines: [
                        'Ski resort in ' + api_result.countryName,
                        '32 novice runs',
                        '16 intermediate runs',
                        '8 expert runs'
                    ],
                    city: 'New York City',

                    lon: lon,
                    lat: lat
                }],
                meta: {
                    zoomLevel: 8,
                    sourceName: "Show piste map",
                    sourceUrl: 'http://www.piste.io/' + api_result.name
                }
            });
        });
    };
}(this));

@@ -253,167 +253,8 @@
    %7D
-%0A%0A        var lon = (Math.round(api_result.location%5B0%5D * 100) / 100).toFixed(2);%0A        var lat = (Math.round(api_result.location%5B1%5D * 100) / 100).toFixed(2);
 %0A   
@@ -613,45 +613,124 @@
 ta: 
-%5B%7B%0A                    id: api_result
+api_result,%0A                normalize: function(data)%7B%0A                    return %7B%0A                        id: data
 .nam
@@ -756,24 +756,22 @@
     
+    
 name: 
-api_result
+data
 .tit
@@ -794,16 +794,20 @@
         
+  
+  
 url: 'ht
@@ -828,33 +828,31 @@
 .io/' + 
-api_result
+data
 .name,%0A
+    
         
@@ -899,34 +899,28 @@
 preview/' + 
-api_result
+data
 .name + '.jp
@@ -923,16 +923,20 @@
 '.jpg',%0A
+    
         
@@ -998,16 +998,68 @@
 n.ico',%0A
+                        //address: 'Hi there', %0A    
         
@@ -1087,16 +1087,20 @@
 ines: %5B%0A
+    
         
@@ -1134,26 +1134,20 @@
  in ' + 
-api_result
+data
 .country
@@ -1148,24 +1148,28 @@
 ountryName,%0A
+    
             
@@ -1222,16 +1222,20 @@
         
+ 
+   
 '16 inte
@@ -1274,16 +1274,20 @@
         
+    
 '8 exper
@@ -1294,16 +1294,20 @@
 t runs'%0A
+    
         
@@ -1341,16 +1341,20 @@
         
+    
 city: 'N
@@ -1393,65 +1393,194 @@
     
+    
 lon: 
-lon,%0A                    lat: lat%0A                %7D%5D
+(Math.round(data.location%5B0%5D * 100) / 100).toFixed(2),%0A                        lat: (Math.round(data.location%5B1%5D * 100) / 100).toFixed(2)%0A                    %7D%0A                %7D
 ,%0A  

Clean up to use DDG style