added api config plus a bunch of fixes on apache2 startup