Generalize api resource