Started on API. Still a work in progress