fixed a bug and changed all internal calls to api

forgot the self in api_timelengthtosecs