Fix copypasta errors in the ApiTask refactor

Also make the API consistent. Constructors should take
in directly the things they need to do their job, and
not just take context.

Change-Id: I51ad0291b35839795e53579a59773d4a47d03375