set-up environment dir and permissions for api-db