integrate setup.php stuff into rest-api.php, split config+data dirs