API call refactoring BackendAPI.js