[api] fix storage of download on demand data in api partially
[api] add test case for adding, editing and removing DoD definitions and complete last fix