Quick fix/fix api and tests