Thanks A Ton Dhanya for the response. It helps a lot.
for the second point, what I meant was, the response from the api gives me clicks,impressions at a keyword level where as I just need the total clicks,impressions for the campaign. how do I get this part.
I understood the other points and implemented. I am struck with the second point here.