Building a gateway application