First commit of API, copied from dashboard repo