json API for /compare
contains definition for function common_files