refactor and start building up json validation schema