You only have to add type checking if the underlying implementation cares, if it doesn't you can disregard this.

You should probably actually end up calling on the onFail rather than throw exceptions.

Additionally you should be doing type checking in the index.js because developers may access your API using URI.