Refractor length of ApiService