Sets correct http string for ajax response on entry error, adds meta data to json response on success full insert via ajax