updated error messaging to send back generic message rather than broad one
removed unused code