Adding a Bucket data structure and a json encoder