public function json($pretty=FALSE) {
		if($pretty) {
			$sorted = $this->payload;
			$this->sortRecursive($sorted);
			return json_encode($sorted, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
		} else {
			return json_encode($this->payload);
		}
	}