Fixed the API according to protocol changes