added a function to stream a JSON representation of the whole database