refactoring

refactored api code
added working fabric tasks
Closes #4