updated to use common API error response.