Fix Job Api not returning the correct stats for pending jobs