wrote logic for server post post.