Use fleet API in functional tests

It's ugly, but it gets the job done. These functional tests could use a lot of love.

Fix #1014 
update the comments in this function?