How to disable debug / stacktrace info on API errors in 2.0

Starting with v.2.0, I started getting full stacktrace in the output of the REST API when there is an error (HTTP code >200). Is there a way to disable it and only show the limited message and the code?