Frontend: added encode support

Encode is now supported by the frontend aswell.