Add failure case checks to Fql and simplify the fql command in js