version with working leads json generation