Api requests refactoring