For the first problem, Which testnet are you using?!
For the second problem, you declared a function named getReserves()
which takes 3 parameters. No problem here but in the function you are calling getReserves()
again and it makes a cycle forever (however you should give it parameters).