Draft code of the GEM api with minimal tests