Implement the environmentGet API endpoint.

Also call it to retrieve the MAAS server address when in MAAS.
Minor grammer: ... we only need to call...