// TODO: move this up
if (apiMetadata instanceof HttpApiMetadata) {
HttpApiMetadata api = HttpApiMetadata.class.cast(apiMetadata);
modules.add(new HttpApiModule(api.getApi()));
} else {
modules.add(new RestModule());
// Minimally bind HttpClient so that Utils works.
modules.add(new AbstractModule() {
@Override public void configure() {
bind(new TypeLiteral<Function<Invocation, Object>>() {
}).to(InvokeHttpMethod.class);