authorizing validate credentials function to return Json array