implements filters && change json to javascript function