refactor request & responses and improve tests