Well; you check to see if there is an article with the appropriate id, but then you fetch the article you consider the possibility that the article's title might be an ID number and you look there, too.
Also, the whole job could be done in one step. Consider this wee story.
If I want a sandwich I go through the following process: I get up from my desk, walk to the other end of the house, open the fridge, search for and find if I have bread, walk back to my desk, and sit down. Then, if there was bread in the fridge, I get up, walk to the other end of the house, search for and find the bread, get the bread out, sudo make myself a sandwich, close the fridge, and take the sandwich back to my desk.
If you can see the biggest drawback to that procedure then I'll point out that your code has the same drawback.