format the thrift API code.