How to change page mode from the plugin API

Currently, the PageNode does not have a getter and setter for variable mode. But it is still possible to get the applied modes via the REST API (or by exporting the page in the JSON_REST_V1 format).