Problem with sending data from Arduino through XBee in API mode

Hello,

I want to make a network where coordinator is collecting data from 3 end devices. End devices are getting data from Arduino through serial port. I want to use them in API2 mode but then i don’t receive anything on my coordinator. When I’m using AT mode i receive data correctly so i thought there is something wrong with the packets i send. However i was using XBee library for Arduino, then just for test i tried to send hardcoded frame generated by X-CTU - and nothing is working. Could you give me any idea what the problem may be?

Here is my test code:

byte packet[] = {0x7E, 0x00, 0x07, 0x83, 0xFF, 0xFC, 0x00, 0x01, 0xFF, 0xFF, 0x82};

void setup() {
  Serial.begin(9600);
}

void loop() {
Serial.write(packet, sizeof(packet));
delay(500);
}

Here is example with XBee.h library (it’s sending value from pin5):

#include <XBee.h>

XBee xbee = XBee();

uint8_t payload[] = { 0, 0 };

Tx16Request tx = Tx16Request(0x0001, payload, sizeof(payload));

int pin5 = 0;

void setup() {

  Serial.begin(9600);
  xbee.setSerial(Serial);

}


void loop() {

 if (millis() - start > 15000) {
      // break down 10-bit reading into two bytes and place in payload
      pin5 = analogRead(5);
      payload[0] = pin5 >> 8 & 0xff;
      payload[1] = pin5 & 0xff;
      
      xbee.send(tx);
}