Updated with targeting included, cleaned up a lot, now uses apikeys and apipaths.