Refactor PostsController using respond_with.