Add listeners to resource and query field