added documentation for encoding API