Refactor, add status code to responses