getting api working better