take into account options for as_json