This returns JOSN data from tables