created script to return db data as json