Fix verify functionality and add endpoint