renamed scmd_ functions to api_
separated matrix update / init