adding xapi lib stuff
img cleanup