Fix id generation logic, schema handling, dry up error throwing