Fix tests
refactor response generation