dynamic functional tests and improving curl middleware