better json handling + apply_style function

modifying the way of handling json + added a apply-style function