Initial implementation of Gateway