Refactor PostsController to use respond_with.