added flags option to jsonable interface.