[api] Take sub-packages into account (dependecy check)

Dependencies are checked in status method, but sub-packages of submitted
package are not taken into account and are reported incorrectly as
missing dependencies. This patch fixes it.