Trouble connecting Xbee S1 to USB port raspberry pi 3

I have a Xbee S1 connected to the USB port of a Raspberry pi 3 and digi.xbee.devices package (python package) is used to set up communication. The communication works fine as long as I have the Xbee connected to the serial port but for some reason it does not work properly with USB, that is the connection is intermittent(the device goes to AT mode in between communication). However, if I check the connection in XCTU it shows API.

The Xbee sends data for a small period time if I disconnect the cable and plug it in again.

I also tried using an USB shield thinking that the unreliable transmission is due to the loose connection in the cable, but that did not help either. The Xbee shows the same error when connected to the laptop as well.

Any help or suggestions that you could offer will be greatly appreciated.