added some validations and remove json root from responses