Refactored generateurl to take in RequestType enum