refactor post controller using 'respond_with'