Clean up repetition in DiscourseApi::Resource

I noticed a lot of repetition was bringing down the Code Climate GPA, so thought I'd clean it up. All tests still pass, nothing new was added in this change set.

I wanted to do something small for my first contribution. Since the [contribution guidelines][guidelines] say you're going for a 4.0 on Code Climate, I thought this would be a good first step.

**Edit:** I initially missed the part about squashing commits into one commit in the Discourse contribution guidelines, but thought I would do that here. Should we follow that practice in Discourse API too? If not, I won't do that from now on.

[guidelines]: http://meta.discourse.org/t/so-you-want-to-help-out-with-discourse/3823