Reusable server url

Improve the re-usability of the addQueryArg() method

- Support SSL protocol
- Make the serverUrl code re-usable
I think we could just use $this->serverUrl here. It was already detected in the constructor; no need to do it again.