Define a wire protocol for non-REST APIs

Change-Id: Id45bb338c57279958b5ea5b436d6a511c74995c7