added json logic for backend