better api setup, added delete functionality