update php swagger to use serialize to show error response 

update php swagger to use serialize to show error response as the json response may not contain the 'message' attribute, which will result in exception