Fixed tests, updated api and interfaces, added basic Pipeline implementation