US terrorism agency to tap a vast database on American citizens