Considerable changes to api, and client; added api util