public void getEventStream(CallBack callback) throws MalformedURLException, IOException {
		HttpRequest request = generateRequest("/eventstream",
				new TreeMap<String, String>(), false);
		ApiResponse response = null;
		response = streamApi(request);
		BufferedReader br = new BufferedReader(new InputStreamReader(response
				.getResponse().asStream()));
		StringBuffer buffer = new StringBuffer();
		char[] tmp = new char[1];
		while (true) {
			try {
				if (br.ready()) {
					@SuppressWarnings("unused")
					int count = br.read(tmp, 0, 1);
					buffer.append(tmp);
					if (buffer.toString().contains("\r\n")
							&& !buffer.toString().isEmpty()) {
						if (buffer.toString().equalsIgnoreCase("\r\n")) {
							// Flush the buffer because we don't want \r\n
							buffer = new StringBuffer();
						}
						// can only handle single level json objects
						while (buffer.indexOf("}") != -1) {
							String json = buffer.substring(0,
									buffer.indexOf("}") + 1);
							callback.onData(gson.fromJson(json, Event.class));
							buffer = new StringBuffer(buffer.substring(json
									.length()));
						}
					}
				}
			} catch (JsonParseException jsone) {
				System.err
						.println("Could not parse JSON " + jsone.getMessage());
				System.out.println("clearing buffer");
				buffer = new StringBuffer();
			}
			catch (Exception e) {
				System.out.println(e.getMessage());
			}
		}
	}