improve to api