There is already a method that returns boolean, which is used in the
REST endpoints, which then throw an exception when it returns false.
Add another one that does the check and throws the exception. This
allows us to simplify the checks in the REST endpoints.
As a result, the exception message thrown when remote admin is not
enabled is the same for all endpoints. Adjust the tests accordingly.
Change-Id: I2e0ebe261a1374369792713b4f2f703df5328f86