formalizing api