added mode="json" where needed