add writeCanvas command to api