Code refactor - updating API and entity class
Organising JS files