error when name already exists in docker run

Signed-off-by: Victor Vieux <vieux@docker.com>
prevent panic in random strategy if no node

Signed-off-by: Victor Vieux <vieux@docker.com>
add simple api tests

Signed-off-by: Victor Vieux <vieux@docker.com>