started added tests and api functions
- will need to refactor a bit