tests: extracted request functions to a separate file