incorporated code review suggestions
replaced  regex with isdigit()
fixed test to mock redirect rather than render
left ap_top as is; left add user code in for now