Added index json template, model relation and now returns data from database.