Add and update resource, policy and app of api return only added or updated entities. Test class modified.