Transforming HTTP status code

How would i go about transforming the status code of a request, say from 200 to 202?

I want to be able to transform a response as well for API with no_content responses. How might i accomplish that.