moves post to server, extensive refactoring