finally getting data from backend to client. will need to refactor.