added ability to delete messages and to return correct http status codes