suport json and both