added paused and resumed endpoints and refactored app