Moved the edit post functionality from client side to server side.