As I have owned several hamsters, I will let you know how you can avoid getting bit.
Hams dont like it when you reach in their territory and they feel cornered. Simply use a cup or something to scoop them up, then drop him off in your hand and they shouldn't ever bite you.