Added http status code when returning an error.