UTI for two month baby boy 😔

Pooja • Baby boy born on march 7th 2016.He is gonna be a big brother soon.. expecting second baby on april 2018
It started all of sudden with high temperature.we thought its just a fever but felt really sadand worried when out primary physician said to take him immediately to ER. He was not drinking much and was crying so much as he is in some pain. They found his urine sample contains lots and lots of bacteria. Started antibiotics through IV and fluid as well as he was not drinking enough and to prevent chance of dehydration. Gave him tylenol every 4 hours till his temperation went down (>100 degree). He is still on oral antibiotics after coming home for next 7 days. 
Have anyone experienced the same situation? Is there any preventive measures ? as doctors are not sure why  it happened to a 2 month old baby. Does anyone know the reason? 
Appretiate any update.