Server side code for companion