Rewrote API to be more compatible