initial full implementation of api_base