protected function serverRequest($path, $context)
	{
		if (strpos($path, '/') === 0)
		{
			$path = substr($path, 1);
		}

		$url = sprintf('http://%s/%s', $this->serverUrl, $path);

		$context = stream_context_create($context);
		$result = @file_get_contents($url, false, $context);

		if ($result === false)
		{
			throw new ClientException('Failed connecting to ' . $url);
		}

		if (($result = json_decode($result)) === false)
		{
			throw new ClientException("Failed decoding json response from server");
		}

		if (empty($result))
		{
			throw new ClientException("Did not receive a valid client instance");
		}

		return $result;
	}