refactored server API request