added handshake to api and made client talk to the server