added all the stuff to the api, still needs tests