First version of working API, unit tests and int tests