I saw a video in which network Co-ordinator is set in API mode and router in AT mode?.Can we have different modes in the same network?
It's a common misconception, but indeed, as @djb_rh said, the interfaces API/AT as well as baud rates can be mixed or matched in any way. The key point to understand is that these only affect the local interface to the module, and the RF link between modules is always the same and is unaffected by choice of mode (API or AT) or baud rate.
I read that there are different AT command frames to carry out different functions like source routing,remote AT commands etc. Now My question is how to set different command frames?. Should I program in arduino to send those corresponding AT command frames serially through xbee to other xbee I wish to communicate?
eg:If i want a router to send a data, Should I create a command frame and send it serially from co-ordinator through zigbee so that router receives it and responds accordingly?
Source routing can be a bit hairy, I would recommend avoiding it until you have more experience and are sure that you need it. Indeed there is a frame to cause a remote module to execute AT commands, frame type 0x17.
If so ,can u show me a small program example to request a data from a router?
I don't happen to have one of those.
since I am using more than one light sensor, I want to address a particular sensor from co-ordinator and ask it to transmit the data only when I need it. Is it possible to do using AT command? If so, how to do it?
There is a command (1S) to force a sample to be taken, I suppose this could be sent via frame type 0x17. I don't operate my nodes this way, however, so I haven't tried it.
At the risk of repeating myself, the best favor you could do yourself is to learn to use Andrew Rapp's library. Otherwise you will be reinventing several large wheels. Of course maybe you want to roll your own API frames and also interpret them on the other end as an exercise, which is fine, but prepare to spend much more time on that than on the actual problem you're trying to solve.
In any event, API mode is the only way to go in order to really take advantage of the XBees' capabilities. AT mode is only good for trivial and non-critical applications, and is terribly cumbersome to use in any advanced scenario.