Refactor operation

Takes Api class and turns it into a proper Operation class