changed implementation exists api function to new specification