criminal cases were usually handled in "maẓālim" courts. these courts were controlled by the ruler's council. "mazalim" courts were supposed to follow "the spirit of sharia". qadis and muftis were present in those courts to make sure the verdicts did not go against it. however, these courts did not necessarily follow the letter of the law, and they had fewer legal restrictions than qadi's courts. "mazalim" courts also handled complaints against government officials. their purpose of "mazalim" courts was to "right wrongs" which could not be addressed through procedures of qadi's courts. less serious crimes were often handled by local police and market inspectors according to local customs, which were only loosely related to sharia.