Dedicated Rest API instance class
The REST client should get abstracted into it's own class.
For a recent reference in Moodle core, look at communication/matrix, or aiproviders.
All http requests should be made using core\http_client, which is a Moodle core implementation of the Guzzle Library.
The client should also handle token caching, mentioned in #84. But this feature can just be copied, from e.g. matrix, they already have solved this cleanly.