implemented server side communication. How to handle different enviroments will come later.