fixed doRequest, some changes to test