Improve remote api unit tests