The story of Jai Jagannath is based on the Lakshmi Purana.
It goes back to the time period when 'untouchables' were not allowed to pray, worship and do rituals to God in the ancient ages. Sriya - one of the important characters in this story dares to pray and worship and wins over the support of Goddess Lakshmi.
The real drama begins when Lakshmi is separated by Lord Jagannath at the behest of his brother Balram (Balabhadra) because she ends discrimination on earth by encouraging even untouchables to conduct rituals and worship.
As Lakshmi moves out of Jagannath's household both Jagannath and Balram (Balabhadra) undergo immense suffering so much so that they have to starve without water and food. The curse of Lakshmi had a severe impact on both the brothers that for 12 years they had a tough time. Soon they realized the importance of Lakshmi and were keen to bring her back to their abode.
Lakshmi returned to Jagannath's abode on one condition that there will be no discrimination of caste and creed on earth. This unique story highlighted that for God everyone was equal besides it reflected the reforms and progressive stance of Gods from the ancient times. Only in the end through Narad it is revealed that Jagannath to end casteism and discrimination had himself "set up" these series of events which highlighted the social message besides the strength of true spirituality.