handshake API

I feel like this buffering bit could be refactored into a function, because it's used in every method