Merged Server/Client code (actually is failing on the instance of the createStage method)