Cleaned the code and refactored how I handle the api module
Implemented few more api functions