added/changed some utility functions
rewrote to use pre-generated api data