declare encoding for api and decode them