magento 2.1 – Get the data from the command API in a custom section of Magento

In Magento2, when we call order API / V1 / orders /: id method = "GET",
magento uses Magento Sales Api OrderRepositoryInterface :: get ($ id) which is defined in the Magento Sales Model OrderRepository :: get ($ id),

My question is therefore: whenever I use one of the classes to retrieve data similar to an API response (json array), they return a PHP object. How can I receive a similar answer?