Reworked implementation to not return encoded json