Merging server code for wf8 and as7