Improved some typehints in the Api class