added pubsub, cleaned up data api slightly

added pub sub package
some clean up on data api, now all functions take a callback