The dynamic API check is a necessity due to breaking API changes in the upstream headscale product, but the current fix doubles up on API calls related to devices. This is not a large issue but should be removed in a future version for minor optimisation purposes.
Perhaps we can move the check from the start of the API call to only if there was an error within the device calling APIs. This would significantly cut down on redundant calls.
The dynamic API check is a necessity due to breaking API changes in the upstream headscale product, but the current fix doubles up on API calls related to devices. This is not a large issue but should be removed in a future version for minor optimisation purposes.