json builder implementation