code: public function execute()
      {
          $result = $this->resultJsonFactory->create();
          try {
              $service = $this->api->checkServiceDetails();
              return $result->setData([
                  'status'            => true,
                  'service'           => $service,
                  'active_version'    => $this->vcl->getCurrentVersion($service->versions),
                  'next_version'      => $this->vcl->getNextVersion($service->versions),
              ]);
          } catch (\Exception $e) {
              return $result->setData([
                  'status'    => false,
                  'msg'       => $e->getMessage()
              ]);
          }
      }
docs: Checking service details
  
  @return \Magento\Framework\Controller\Result\Json