Helper with function to parse data to json using SQL Alchemy