Added more working code from old samples and started to refactor URL into URLWithQuery and default parameters