added rest adapter and small fixes elsewhere