Hi,
I have been working on android from past 5 years, I mainly work on utilizing third party jar library APIs into an application.
For your requirement I would propose following solution.
1. Please share more details about the type of server you have.
2. If APIs are directly available would create an AsyncTask to perform this shutdown or restart operation for responsiveness of app, since it performs in background.
3. Error handling module for all server based error handling.
I would be able to provide more accurate solution if you provide more details.
Regards,
Kamlesh