changed API to get terms and docs in fields