Validate application id

Use Form class to validate that id is a non-negative integer if provided
in the query string.

Bug: 58306
Change-Id: I38224f124d45a82a18c2fb99b37db48126c027d2
Merge "Validate application id"