As you've noticed, '-니' and'-어' can be both used in making questions in casual setting. However you cannot use '-니' for answering while you can both use '-어' for a question and an answer.
Here is one more difference between '-니'and'-어'. You can use '-어' to a older person when he/she is very close to you.
e.g. 형, 밥 먹었어? 언니, 이거 먹어. (O)
However, you CANNOT use '-니' to an older person even if he/she is close to you.
e.g. 형, 밥 먹었니? (X)