Fix rest api (Closes #5)