Move config to environment variables. Move objectId handling to database