add all js dependencies and fix api bug for returning matches