use json.parse only when returning data is string