You can't wave a finger in a birds face and not expect him to bite it... you have to respect the birds space... form a bond...
Unlike a dog, a bird won't just accept you and think of being friends...(not talking down about dogs, but they are more loving and friendly with less work)
A bird has to feel you.. its all about trust and respect, and once you have it, you and those birds will be inseparable it takes time and baby steps.
Yep waving a finger like that will get bit... but that is not a bite, it's an attempted bite. I have a lovebird pair and apparently the male was tame before being put with the female. He's got a bloody good bite on him and can draw blood in a split second. He tricks you into thinking he is going to be nice and then wham your finger is toast.
Sorry but were you surprised that birdie bit you? Sometimes they bite even after having developed a bond and trust. You have to learn your bird's body language and cues and anticipate his behaviour to avoid putting him in the situation where he thinks he must bite you. Basil may bite me if I stick a finger in his cage like that. So I don't.