Added api and fixed client