Added a clean up function for deletion and made it RESTier