generalizing the successful_response method