Sending endcode with API:printer/stop. Refactored start- and endcode generation