private function toJsonRequest($accounts) {
    $jsonUsers = array();
    foreach($accounts as $account) {
      $user = array(
        'email' => $account->getEmail(),
        'localId' => $account->getUserId(),
        'emailVerified' => $account->isEmailVerified(),
        'displayName' => $account->getDisplayName(),
        'passwordHash' => Google_Utils::urlSafeB64Encode(
            $account->getPasswordHash()),
        'salt' => Google_Utils::urlSafeB64Encode($account->getSalt())
      );
      array_push($jsonUsers, $user);
    }
    return $jsonUsers;
  }