adding readme, further splitting up API to enable unit testing