Propagate error messages and status from the SWF API

Without these patches, errors from the SWF API are hidden by a `non 200` error message.