Make decode function compatible with API