setup database and routing