You can use Universal Dashboard OutREST to generate REST API based on Universal Dashboard from Modules and Functions you already have.
Install-Module UniversalDashboard.OutRest
$Endpoints = Out-UDRestApi -Command "Get-Service"
Start-UDRestApi -Endpoint $Endpoints -Port 10000
Invoke-RestMethod -Method Get -Uri "http://localhost:10000/api/Service"
$Endpoints | Select Url
Url
---
/Service
/Service/:DisplayName