Move API stuff into own provider