Fixed bug in ModelAPI