travis-ci/travis-api — pull request #70 by drogus (2013-08-08 12:30:53+00:00)
Title: Implement jobs/:id/cancel and builds/:id/cancel endpoints

I was going a bit back and forth with this, because I was not sure how I should handle it properly. In most of the places where we do some specific actions, like sync, we usually do:

```ruby
respond_with service(:some_service, params)
```

What bothers me with such style is that services, which are not finds usually don't care what is returned, so it may be `true` or something which is equally not useful. We also don't do a very good job at returning proper messages and response codes. That's why I went for more explicit handling and I use service API to check what should I return to the client. I think that this might be generalized somehow in the future, but I would not do that just now - we have quite a few places in the API where automation makes it a bit hard to customize things.