Lost connection to api

Yes

sudo service pihole-FTL stop
sudo rm /etc/pihole/pihole-FTL.db
sudo service pihole-FTL start

is the nuclear option that will always work.