abstracting autcomplete for relations