added tests, travis and coverage integration, fixed api bugs