Make APIService behave well with UI thread