splitting server and rpi code