Changes at apiModel, added tests