types-exists rest api implementation