bug fixes and code tidy up

check for null json objects when releasing ip from server.
differentiate between boot and data drives by checking for presence (or absence) of image-type attribute