Add factory method for RestAPI

Signed-off-by: Ian Macalinao <ian@giza.us>