jsonified hosts api and changed the way to delete a host