Added server communication model and implementation in MainActivity.