Adding retry logic to the withPool snaplet provided function
Fixing a few import bugs and other type related issues