Implemented an authentication and apikey exchange.