Got the api working