Added various functionalities location lookup and category assignment, plus linking with frontend. Also refactor.