Added custom exception.
Removed unused module (since we are using flask now)