add rest api for the types