major cleanup of ApiService and test