got the api working, a bit of cleanup
shit is broken