implemented the rest api for getting example queries