refactor: api request and response