refactor Network Api logic