Fixed send of valide JSON and completed db insert