refactored and feeling good. basic api stuff