API Call can be simplified? - C#