Api updates, almost done!
Updated to work better with an API