add a simple test to ensure encoding api is present and works
add `apply/3`