updated code for the server and Android