added response codes and protocol