Begins creating api endpoint