Automatic calculation of API context when deploying in tenants