added send-receive functionality for the API