Refactor types in Client and allow to respond with file.