Update Api.php

removed legacy bits, defined more private methods