fixup : cleanup_on_failure need to store a method as first argument, avoid bad exception on http_post_collertion() failure

Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com>
Merge pull request #20 from nplanel/fixup_IFMapApiGenerator_cleanup_on_failure

fixup : cleanup_on_failure need to store a method as first argument, avo...
     - Added remove function to remove element from a list.
     - Modified clear list function to empty the list if it's not empty,
       so when the object is converted to json, it will have empty [] list.