Add secure option to client, simplify url building