API Version detection

detect api version:

  * if > v1 use sgv field instead of bg to be compatable to direct mongo upload
  * if not v1 assume legacy and send data the way project-glu expects it