Updated engine API + wrote test example