Added TLS socket connection to the API