Wrote server code for creating a new post