work with browserify easily

quick change to make it work with browserify so you just get the client side stuff instead of the server api.