add nested submodules support

add support of nested submodules for api.js