api: ping the database before assuming that everything is ok