Fixed REST endpoint generation bug