change backend script so it outputs json