Added some error checking and proper database clear response