If you need to restart or power off your RPi remotely (or through local application’s call) here’s a simple way
http://raspberry.address:7000/reboot http://raspberry.address:7000/power/off
Details and code at https://github.com/zdanek/raspiPowerServer