Introduce proper http authentication API