I want to return proper status codes if something went wrong, e.g. 404 if a resource is not found or 403 if the permission is not sufficient.
In .net web api, one can express that with the return type. If you use IHttpActionResult or HttpResponseMessage you can modify the headers beside the content.
So I wonder if there's a similar method to return the status code beside the content in the API designer?
I tried it with HttpResponseMessage but had no luck (it returns the object as JSON with status code 200).