add option for json output for diagnostics, make find providers count argument optional