added prototype encoder decoder APIs