var jsonist = require('jsonist');

function KeenClient (options = {}) {
  this._urlBase = options.urlBase || 'https://api.keen.io';
  this._version = options.version || '3.0';
  this._writeKey = options.writeKey;
  this._readKey = options.readKey;
  this._masterKey = options.masterKey;
  this._projectId = options.projectId;
  this._url = `${this._urlBase}/${this._version}/projects/${this._projectId}/events`;
}

function apiOptions(apiKey) {
  return {
    headers: {
      'Content-Type': 'application/json',
      'Authorization': apiKey
    }
  };
}

KeenClient.prototype._getUrl = function (path) {
  return path ? `${this._url}/${path}` : this._url;
};

KeenClient.prototype.addEvent = function (collection, event, callback) {
  if (!collection) {
    return callback(new Error('you must specify a collection'));
  }
  
  jsonist.post(this._getUrl(collection), event, apiOptions(this._writeKey), callback);
};

KeenClient.prototype.addEvents = function (events, callback) {
  jsonist.post(this._url, events, apiOptions(this._writeKey), callback);
};

KeenClient.prototype.getEvent = function (collection, callback) {
  if (!collection) {
    return callback(new Error('you must specify a collection'));
  }
  
  jsonist.get(this._getUrl(collection), apiOptions(this._masterKey), callback);
};

KeenClient.prototype.getEvents = function (projectId, callback) {
  var url = `${this._urlBase}/${this._version}/projects/${projectId}/events`;
  jsonist.get(url, apiOptions(this._masterKey), callback);
};

module.exports = KeenClient;

@@ -210,43 +210,8 @@
 ey;%0A
-  this._readKey = options.readKey;%0A
   th
@@ -382,19 +382,19 @@
 unction 
-api
+req
 Options(
@@ -682,23 +682,17 @@
 event, c
-allback
+b
 ) %7B%0A  if
@@ -712,39 +712,33 @@
 ) %7B%0A    return c
-allback
+b
 (new Error('you 
@@ -822,19 +822,19 @@
  event, 
-api
+req
 Options(
@@ -843,39 +843,33 @@
 is._writeKey), c
-allback
+b
 );%0A%7D;%0A%0AKeenClien
@@ -911,23 +911,17 @@
 vents, c
-allback
+b
 ) %7B%0A  js
@@ -950,19 +950,19 @@
 events, 
-api
+req
 Options(
@@ -975,31 +975,25 @@
 writeKey), c
-allback
+b
 );%0A%7D;%0A%0AKeenC
@@ -1042,23 +1042,17 @@
 ction, c
-allback
+b
 ) %7B%0A  if
@@ -1080,23 +1080,17 @@
 return c
-allback
+b
 (new Err
@@ -1174,19 +1174,19 @@
 ction), 
-api
+req
 Options(
@@ -1200,31 +1200,25 @@
 asterKey), c
-allback
+b
 );%0A%7D;%0A%0AKeenC
@@ -1271,119 +1271,190 @@
 d, c
-allback) %7B%0A  var url = %60$%7Bthis._urlBase%7D/$%7Bthis._version%7D/projects/$%7BprojectId%7D/events%60;%0A  jsonist.get(url, api
+b) %7B%0A  jsonist.get(this._url, reqOptions(this._masterKey), cb);%0A%7D;%0A%0AKeenClient.prototype.deleteCollection = function (collection, cb) %7B%0A  jsonist.delete(this._getUrl(collection), req
 Opti
@@ -1480,15 +1480,9 @@
 ), c
-allback
+b
 );%0A%7D

Remove _readKey. Minor cleanup