fix api and make it async