moving cosm API code to separate module
debugged COSM submission