Reorganized js files and created apiService.js