Update api.php

forgot cache_key that was defined in other pull request
removed hackish default value and using method provided by @n4r-c0m