1. A method for creating a code implementing an API, wherein a set of objects has been numbered, the API accessing object states and transitions, the method comprising: reading the API and defining a corresponding set of object states expressed by a list of Boolean variables, initial object state values and object states transitions; reading the defined object states, the initial object state values and transitions and creating a set of corresponding truth tables; reading the created set of truth tables and performing a transitive closure of the starting states providing as a result a list of possible object states among the defined object states; numbering the possible objects states; reading the set of truth tables and, using the numbered possible object states, creating a new set of truth tables; and reading the new set of truth tables and generating code for implementing the transitions by using a bitfield encoding of the numbered objects.