Add $protocol parameter to support HTTPS

- Added protocol parameter to constructor and REST URL creation