JSON Building in Node.js with YQL parsing

Respected ppl ....

This is my node.js code ... https://gist.github.com/SkyKOG/99d47dbe5a2cec97426b

Im trying to parse the data of our exam results ...example ... http://www.vtualerts.com/results/get_res.php?usn=1MV09IS002&sem=7

Im getting the results ...

            json.results = [];

            var output = '';

            var k = response.query.results.body.div.div[0].table[1].tr.length;

            for (var j = 1; j < k; j++) {

                for (var i = 0; i <= 5; i++) {
                    var result_obj = {};
                    result_obj.subjects = [];

                    for (key in response.query.results.body.div.div[0].table[1].tr[j].td[i]) {
                        if (typeof response.query.results.body.div.div[0].table[1].tr[j].td[i].em === "undefined") {
                            continue;
                        }

                        var subject_obj = {};

                        output += "Subject : " + response.query.results.body.div.div[0].table[1].tr[j].td[i].em + " " + "\n";

                        var subtext = response.query.results.body.div.div[0].table[1].tr[j].td[i].em + " " + "\n";
                        subject_obj.subjectname = subtext.replace(/[(].*[)]/, "").trim();

                        result_obj.subjects.push(subject_obj);
                        console.log(subject_obj);
                        break;

                    }

                    console.log(result_obj.subjects);

And to get the JSON in this format ... https://gist.github.com/SkyKOG/3845d6a94cea3b744296 I dont think im pushing the created objects at the right scope ... The subject array which im pushing to ends up being empty ....

Kindly help in this regard .... thank you ...