changing logic of HTTP Request to reading file