Better implement get_connected_calls function

I've changed the query in the "get_connected_calls" function for more secure way (via API).