refactored into separate classes
made api package