Null exception in REST