My first attempt at building an API