No luck trying to make two XBees communicate in API mode with arduino XBee library.
I fixed the problem. If you look at the code, you'll notice that I had not specified pinmode of the input and output pins.

The fix is to include the following lines in the router and coordinator code, respectively:


The line below is missing in router code:

pinMode(8,  OUTPUT);

And the line below is missing in coordinator code:

pinMode(7,  INPUT);