How to search and add end device to network without using X-CTU software?

Hi,
Recently, We have bought 4 Xbee module for our project, in which one of them will act as coordinator(connected to RPi 3)and the rest of three as the end device(connected to RPi zero). In future end device could be anything(led bulbs, sensors which are Zigbee compatible). So, we have some queries regarding these…

a). How to set parameter of coordinator using c programming(without using X-CTU software)?
b). How End device can be connected to the coordinator?
c). How does the coordinator know that end device connected or not?
d). How can I send or receive data to or from the specific end device?

We want to do the above things using c programming (without using X-CTU software) with raspberry pi 3. We have done some study on that but we did not get exactly what we want.

If anyone knows, please share some information or link!

Thanks!!