[api] Use resource.env instead of resource.isProduction