change core.CGRequest() to self written request() function