Added JSON functionality to pass data to DB